package immutable;

import java.util.Objects;

/**
 * @Description: null
 * @Project: testDemo
 * @Author: hjibo
 * @CreateDate: 2019-01-22 21:17
 * @ModificationHistory:
 */
public final class ImmutableClass {

    private final String a;

    public ImmutableClass(String a) {
        this.a = a;
    }

    public String getA() {
        return a;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImmutableClass that = (ImmutableClass) o;
        return Objects.equals(a, that.a);
    }

    @Override
    public int hashCode() {
        return Objects.hash(a);
    }
}
